package ia;


public abstract class Nodo {
	
    protected  int         _id;
    protected  int         _x;
    protected  int         _y;
    protected  Orientacion _or;
    protected  float       _coste;
    protected  float       _transicionCoste;
    protected  float       _valorH;

    
    public Nodo(int x1, int y1, Orientacion or){
        _id      = 0;
        _x       = x1;
        _y       = y1;
        _or      = or;
        _coste   = 0;
        _valorH  = -1;
    }
    
    public abstract void setPadre(Nodo nPadre);
    public abstract Nodo getPadre();
    public abstract boolean puedeMover(int[][] matriz);
    public abstract Nodo mover(int[][]matriz, Orientacion orientacion);

	
    public void setId(int id){
        _id = id;
    }
    
    public int getId(){
        return _id;
    }
    
    public int getX(){
        return _x;
    }

    public int getY(){
        return _y;
    }

    public Orientacion getOrientacion(){
        return _or;
    }
    
    public void setCoste(float nuevoCoste){
        _coste = nuevoCoste;
    }

    public float getCoste(){
        return _coste;
    }
    
    public void setTransicionCoste(float c){
        _transicionCoste = c;
    }
    
    public float getTransicionCoste(){
        return _transicionCoste;
    }
    
    public void setVHeuristica(float valor){
        _valorH = valor;
    }
    
    public float getFinal(){
        return _valorH  + _coste;
    }
    
    public boolean igualPos(int[] p){
        if(p[0]==_x & p[1]==_y)return true;
        else return false;
    }
}
